package com.piece.blog.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 试卷题目 training_question
 *
 * @author onepiece
 * @date 2023-09-12
 */
@Data
@NoArgsConstructor
@Entity
@Table(name = "training_question")
@ApiModel(value = "试卷题目")
public class TrainingQuestion implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "question_id", length = 11)
    @ApiModelProperty(value = "题目ID")
    private Long questionId;

    @Column(name = "type")
    @ApiModelProperty(value = "题目类型：0：单选、1：多选、2：判断、3：填空、4：主观")
    private String type;

    @Column(name = "option_type")
    @ApiModelProperty(value = "选项类型：0：文字、1：图片、2：音频")
    private String optionType;

    @Column(name = "content")
    @ApiModelProperty(value = "题目名称")
    private String content;

    @Column(name = "analysis")
    @ApiModelProperty(value = "题目解析")
    private String analysis;

    @Column(name = "answer")
    @ApiModelProperty(value = "题目答案")
    private String answer;

    @Column(name = "difficulty")
    @ApiModelProperty(value = "题目难度")
    private Long difficulty;

    @Column(name = "score")
    @ApiModelProperty(value = "题目分值")
    private Long score;

    @Column(name = "tag_id")
    @ApiModelProperty(value = "题目标签")
    private Long tagId;

    @Column(name = "status")
    @ApiModelProperty(value = "状态（0有效 1无效）")
    private String status;

    @Column(name = "create_by")
    @ApiModelProperty(value = "创建人ID")
    private Long createBy;

    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

}
